<template>
	<view class="page_view">
		<view class="list">
			<view class="list-item" v-for="(item,index) in list">
				<view class="list-item-left">
					<view class="list-item-left-top">
						{{item.shopname}}
					</view>
					<view class="list-item-left-bottom">
						发票金额：<text class="list-item-left-bottom-num">{{item.price}}</text>元 
						<view class="list-item-left-bottom-right1">
							<text class="list-item-left-bottom-right">审核结果：</text>
							<text class="list-item-left-bottom-jieguo sh0" v-if="item.sh == 0">审核中</text>
							<text class="list-item-left-bottom-jieguo " v-if="item.sh == 1">已通过</text>
							<text class="list-item-left-bottom-jieguo sh2" v-if="item.sh == 2">已驳回</text>
							<text class="list-item-left-bottom-jieguo sh2" v-if="item.sh == 3">已使用</text>
							<view class="">
								{{item.reason}}
							</view>
						</view>
					</view>
				</view>
				<image :src="baseUrl.imageUrl+item.img" class="list-item-right" mode=""></image>
			</view>
			
		</view>
	</view>
</template>

<script>
	import config from '@/utils/base.js';
	export default {
		data() {
			return {
				list:[],
				page:1,
				limit:15,
				last_page:'',
				baseUrl:config
			}
		},
		onLoad() {
			this.get_list()
		},
		onReachBottom() {
			if(this.page < this.last_page){
				this.page++;
				this.get_list()
			}else{
				uni.showToast({
					title:'已经到底了哦',
					icon:'none'
				})
			}
		},
		methods: {
			get_list(){
				let  t = this
				this.$post({
					url:'/wanlshop/tickets/get_invoice_list',
					data:{
						page:t.page,
						limit:t.limit
					}
				}).then(res=>{
					console.log(res)
					t.list = [...t.list,...res.data.data],
					t.last_page = res.data.last_page
				})
			}
		}
	}
</script>

<style scoped>
page{
	background-color: #fff;
}
.list{
	width: 100%;
	padding: 0 30rpx;
	box-sizing: border-box;
}
.list-item{
	width: 100%;
	height: 200rpx;
	border-bottom: #F4F4F4 solid 2rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.list-item-right{
	width: 140rpx;
	height: 140rpx;
	border-radius: 12rpx;
	border: solid 2rpx #F4F4F4;
}
.list-item-left-top{
	font-size: 32rpx;
	font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
	font-weight: normal;
	color: #000000;
}
.list-item-left-bottom{
	font-size: 24rpx;
	color: #333333;
	margin-top: 20rpx;
	display: flex;
	align-items: center;
}
.list-item-left-bottom-num{
	font-size: 36rpx;
	color: #E32D1D;
}
.list-item-left-bottom-right{
	/* margin-left: 54rpx; */
}
.list-item-left-bottom-right1{
	margin-left: 54rpx;
}
.list-item-left-bottom-jieguo{
	color: #41C240;
}
.sh0{
	color: #000;
}
.sh2{
	color: #E32D1D;
}
</style>
